package com.luoxiang.socialandroid.dialog

import android.content.Context
import com.luoxiang.socialandroid.R
import com.luoxiang.socialandroid.databinding.DialogBottomsheetBinding
import com.luoxiang.socialandroid.databinding.DialogTipBinding
import com.luoxiang.socialandroid.utils.CustomClickListener
import com.lxj.xpopup.core.BottomPopupView
import com.lxj.xpopup.impl.FullScreenPopupView

class Bottomsheet6Dialog(context: Context) : BottomPopupView(context) {
    private lateinit var mViewBinding: DialogBottomsheetBinding
    private var cancel: String? = null
    private var onCancelClickListener: (() -> Unit)? = null
    private var onJubaoClickListner: (() -> Unit)? = null
    private var onQuxiaoClickListner: (() -> Unit)? = null
    override fun getImplLayoutId() = R.layout.dialog_bottomsheet
    override fun onCreate() {
        super.onCreate()
        mViewBinding = DialogBottomsheetBinding.bind(popupImplView)
        mViewBinding.textView27.text = cancel
        mViewBinding.textView27.setOnClickListener { onCancelClickListener?.invoke() }//拉黑的点击事件
        mViewBinding.textView28.setOnClickListener { onJubaoClickListner?.invoke() }//举报的点击事件
        mViewBinding.tvQuXiao.setOnClickListener { onQuxiaoClickListner?.invoke() }//取消的点击事件
    }

    fun setCancel(cancel: String) {
        this.cancel = cancel
        if (this::mViewBinding.isInitialized){
            mViewBinding.textView27.text = cancel
        }
    }
    fun setOnCancelClickListener(onCancelClickListener: () -> Unit) {
        this.onCancelClickListener = onCancelClickListener
    }

    fun setOnjubaoClickListner(onJubaoClickListener: () -> Unit) {
        this.onJubaoClickListner = onJubaoClickListener
    }

    fun setQuxiaoClickListner(onQuxiaoClickListener: () -> Unit) {
        this.onQuxiaoClickListner = onQuxiaoClickListener
    }


}